<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="gq143896">gp_endpoints</title>
  <body>
    <p>The <codeph>gp_endpoints</codeph> view lists the endpoints created for all active
      parallel retrieve cursors declared by the current session user in the current
      database. When the Greenplum Database superuser accesses this view, it returns a
      list of all endpoints created for all parallel retrieve cursors declared by all users
      in the current database.</p>
    <p>Endpoints exist only for the duration of the transaction that defines the
      parallel retrieve cursor, or until the cursor is closed.</p>
    <table id="gq143898">
      <title>gp_endpoints</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="121pt"/>
        <colspec colnum="2" colname="col2" colwidth="60pt"/>
        <colspec colnum="3" colname="col3" colwidth="60pt"/>
        <colspec colnum="4" colname="col4" colwidth="247pt"/>
        <thead>
          <row>
            <entry colname="col1">name</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1">gp_segment_id</entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">The QE's endpoint <codeph>gp_segment_id</codeph>.</entry>
          </row>
          <row>
            <entry colname="col1">auth_token</entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The authentication token for a retrieve session.</entry>
          </row>
          <row>
            <entry colname="col1">cursorname</entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the parallel retrieve cursor.</entry>
          </row>
          <row>
            <entry colname="col1">sessionid</entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">The identifier of the session in which the parallel
              retrieve cursor was created.</entry>
          </row>
          <row>
            <entry colname="col1">hostname</entry>
            <entry colname="col2">varchar(64)</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the host from which to retrieve the data
              for the endpoint.</entry>
          </row>
          <row>
            <entry colname="col1">port</entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">The port number from which to retrieve the data for
              the endpoint.</entry>
          </row>
          <row>
            <entry colname="col1">username</entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The name of the session user (not the current user);
              <i>you must initiate the retrieve session as this user</i>.</entry>
          </row>
          <row>
            <entry colname="col1">state</entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The state of the endpoint; the valid states are:
              <p>READY: The endpoint is ready to be retrieved.</p>
              <p>ATTACHED: The endpoint is attached to a retrieve connection.</p>
              <p>RETRIEVING: A retrieve session is retrieving data from the endpoint at this moment.</p>
              <p>FINISHED: The endpoint has been fully retrieved.</p>
              <p>RELEASED: Due to an error, the endpoint has been released and the connection
                closed.</p></entry>
          </row>
          <row>
            <entry colname="col1">endpointname</entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">The endpoint identifier; you provide this identifier
              to the <codeph>RETRIEVE</codeph> command.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
